﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BaseSet.Data;
using BaseSet.Logic;
using BaseSet.Entity;
using BaseSet.Framework;
using BaseSet.Entity.Common;
using BaseSet.Entity.Common.Text;
using BaseSet;
using System.Data;

namespace WebSite.Admin.SystemSet
{
    public partial class NewsTypeAdd : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        #region 添加
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string newstypeid = txtNewsTypeID.Text.Trim();
            string newstypename = txtNewsTypeName.Text.Trim();

            if (string.IsNullOrEmpty(newstypeid))
            {
                Tools.Alert("请填写类别ID！");
                return;
            }

            if (string.IsNullOrEmpty(newstypename))
            {
                Tools.Alert("请填写类别名称！");
                return;
            }

            NewsType ntype = new NewsType();
            NewsTypeHelper nthelper = new NewsTypeHelper();

            ntype.ID = newstypeid;
            ntype.NewsTypeName = newstypename;
            nthelper.AddNewsType(ntype);

            Tools.AlertAndRedirect("添加成功！", "NewsTypeManager.aspx");
        }
        #endregion

        #region 返回
        protected void ReturnBtn_Click(object sender, EventArgs e)
        {
            Response.Redirect("NewsTypeManager.aspx");
        }
        #endregion
    }
}